from django.contrib import admin

from byxiaomi.models import FeedBack, Student


# Register your models here.
@admin.register(FeedBack)
class FeedBackAdmin(admin.ModelAdmin):
    # 1.指定显示的字段
    list_display = ["id", "quality", "attitude", "speed", "text", "annoy", "user_id"]
    # 2.指定筛选过滤的字段
    list_filter = [
        "quality",
        "attitude",
        "speed",
        "annoy",
    ]
    # 3.对指定字段进行搜索
    search_fields = [
        "text",
    ]
    # 4.设置分页(每一页显示的记录)
    list_per_page = 10

    # 5.指定哪些字段可以点击之后进入到评价详情里面去
    list_display_links = [
        "text",
    ]
    # 6.在列表中对指定字段进行编辑（一般不会这么使用，风险很大）
    # list_editable = [
    #     "quality",
    #     "attitude",
    #     "speed",
    #     "annoy",
    # ]


@admin.register(Student)
class StudentAdmin(admin.ModelAdmin): ...
